package com.study5i.demo;

/**
 * @auther KangJiaChen
 * @date 2024/7/13 8:50
 */
public class CompantsFactory {


    public static AbstractCompants getCompantsService(String tag){
        if (tag.equals("A")){
            return new CompantsA();
        } else if (tag.equals("B")) {
            return new CompantsB();
        } else if (tag.equals("C")) {
            return new CompantsC();
        }

        throw new RuntimeException("tag错误");
    }


}
